﻿if (typeof GigyaToolbar=='undefined' && navigator.appVersion.toLowerCase().indexOf('iphone')==-1) {
    var GigyaToolbar = {};
    GigyaToolbar.createTheme=function(name,basePath,textboxColor,captionColor,baseColor) {
        return {name:name,basePath:basePath,textboxColor:textboxColor,captionColor:captionColor,baseColor:baseColor};
    }  
    GigyaToolbar.themes = {
        gray: GigyaToolbar.createTheme('gray','http://toolbar.cdn.gigya.com/i/','#3883c5','#3883c5','#656565'),
        blue: GigyaToolbar.createTheme('blue','http://toolbar.cdn.gigya.com/i/Blue/','#656565','#0078a4','#656565')
    }
    GigyaToolbar.isIE6=(navigator.appVersion.indexOf('MSIE 6.')==-1)?false:true;
    GigyaToolbar.createMapping=function(id,w,h) {
        return {id:id,w:w,h:h}
    }
    GigyaToolbar.imageSizes=[
        GigyaToolbar.createMapping('bg_left',15,33),
        GigyaToolbar.createMapping('collapse',24,33),
        GigyaToolbar.createMapping('gsb',123,33),
        GigyaToolbar.createMapping('tbStatus',152,33),
        GigyaToolbar.createMapping('btnLike',97,33),
        GigyaToolbar.createMapping('btnLikeDisabled',97,33),
        GigyaToolbar.createMapping('btnFanPage',96,33),
        GigyaToolbar.createMapping('btnUpdates',85,33),
        GigyaToolbar.createMapping('btnShare',79,33),
        GigyaToolbar.createMapping('btnLogout',16,33),
        GigyaToolbar.createMapping('btnEmail',15,33),
        GigyaToolbar.createMapping('btnRSS',14,33),
        GigyaToolbar.createMapping('btnInfo',23,33),
        GigyaToolbar.createMapping('separator',2,33),
        GigyaToolbar.createMapping('expand',31,33),
        GigyaToolbar.createMapping('dlg_topLeft',13,34),
        GigyaToolbar.createMapping('dlg_topRight',22,34),
        GigyaToolbar.createMapping('dlg_bottomLeft',13,12),
        GigyaToolbar.createMapping('dlg_bottomRight',22,12),
        GigyaToolbar.createMapping('dlg_bubble',30,28),
        GigyaToolbar.createMapping('ttPleaseLogin',120,22),
        GigyaToolbar.createMapping('ttUpdateSent',92,22),
        GigyaToolbar.createMapping('ttStatusChangedToLike',215,22),
        GigyaToolbar.createMapping('bubbleLeft',10,19),
        GigyaToolbar.createMapping('bubbleRight',10,19)
    ]
    GigyaToolbar.createThemeMapping=function() {
        GigyaToolbar.themeMapping={}
        var y=0;
        for (var i=0;i<GigyaToolbar.imageSizes.length;i++) {
            var img=GigyaToolbar.imageSizes[i];
            GigyaToolbar.themeMapping[img.id]={w:img.w,h:img.h,y:y};
            y+=img.h;
        }    
    }

    GigyaToolbar.fixPositions = function() {
        var toolbar=GigyaToolbar.toolbarDiv;
        var de=document.documentElement;
        var db=document.body;
        var scrollTop=de.scrollTop;
        if (scrollTop==0) scrollTop=db.scrollTop;
        var clientHeight=de.clientHeight;
        if (clientHeight==0) clientHeight=db.clientHeight;    
        var clientWidth=de.clientWidth;
        if (clientWidth==0) clientWidth=db.clientWidth;    
        if (GigyaToolbar.isIE6) clientWidth-=1;
	    toolbar.style.top=scrollTop+clientHeight-33;
	    toolbar.style.width=clientWidth;
	    GigyaToolbar.divExpand.style.top=toolbar.style.top;
	    GigyaToolbar.divTooltip.style.top=scrollTop+clientHeight-30;
	    if (GigyaToolbar.gigyaTBBox)
	        GigyaToolbar.gigyaTBBox.style.top=''+(scrollTop+clientHeight-GigyaToolbar.gigyaTBBox.offsetHeight-26)+'px';
	    if (GigyaToolbar.divWelcome)
	        GigyaToolbar.divWelcome.style.top=''+(scrollTop+clientHeight-GigyaToolbar.divWelcome.offsetHeight-26)+'px';
	    //GigyaToolbar.divEmail.style.top=scrollTop+clientHeight-gigyaTBBox.style.offsetHeight;
    }
    GigyaToolbar.onResize = function() {
	    if (GigyaToolbar.gigyaTBBox)
	        GigyaToolbar.gigyaTBBox.style.left=''+(GigyaToolbar._GetElementPos(GigyaToolbar.currentIframeButton).left+5-GigyaToolbar.gigyaTBBox.offsetWidth+GigyaToolbar.currentIframeButton.offsetWidth)+'px';
    }
    GigyaToolbar._GetElementPos=function(obj) {
        var curLeft = curtop = 0;
        if (obj.offsetParent) {
	        do {
		        curLeft += obj.offsetLeft;
		        curtop += obj.offsetTop;
	        } while (obj = obj.offsetParent);
        };
        return {left:curLeft,top:curtop};
    }	
    
    GigyaToolbar.generateImgStyle = function (name,sizingMethod) {
        return GigyaToolbar.generateImgStyle2(GigyaToolbar.theme.basePath+name+'.png', sizingMethod);
    }
    GigyaToolbar.generateImgStyle2 = function (url,sizingMethod) {
        if (GigyaToolbar.isIE6) {
            if (sizingMethod==null) sizingMethod='scale';
            return 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=\'true\', sizingMethod=\''+sizingMethod+'\',src=\''+url+'\');';
        } else {
            return 'background-image:url('+url+');';
        }
    }
    GigyaToolbar.generateImgDiv=function(url,w,h) {
        return '<div style="width:'+w+'px;height:'+h+'px;background-repeat:no-repeat;'+GigyaToolbar.generateImgStyle2(url,'crop')+'"></div>';
    }    
    GigyaToolbar.getCutDivHTML=function(name,id) {
        var oCut=GigyaToolbar.themeMapping[name];
        if (oCut==null) return '';
        if (id==null) id='';
        var w=oCut.w;
        var h=oCut.h;
        if (GigyaToolbar.isIE6) {
            return '<div id="'+id+'" style="font-size:1px;overflow:hidden;position:relative;width:'+w+'px;height:'+h+'"><div style="clip:rect('+oCut.y+'px,'+w+'px,'+(oCut.y+h)+',0px);position:absolute; top:-'+oCut.y+'px;left:0px;"><div style="width:'+w+'px;height:'+h+'px;'+GigyaToolbar.generateImgStyle('theme','image')+'"></div></div></div>';
        } else {
            return '<div id="'+id+'" style="font-size:1px;background-position:0px -'+oCut.y+'px;width:'+oCut.w+'px;height:'+oCut.h+'px;background-repeat:no-repeat;'+GigyaToolbar.generateImgStyle('theme','image')+'"></div>';
        }
    }    
    GigyaToolbar.generateImgTd=function(name,padding,onclick,id) {
        var cursor='pointer';
        var btnId=id+'_img';
        if (onclick==null) {
            onclick='';
            cursor='default';
        }
        if (id==null) {
            id='';
            btnId='';
        }
        'background-repeat:repeaty;'+GigyaToolbar.generateImgStyle('Bg_Mid');
        return '<td width="'+GigyaToolbar.themeMapping[name].w+'" id="'+id+'" onclick="'+onclick+'" style="cursor:'+cursor+';background-repeat:background-repeat:repeaty;margin:0px;padding:0px;padding-right:'+padding+'px;padding-left:2px;'+GigyaToolbar.generateImgStyle('Bg_Mid')+'">'+GigyaToolbar.getCutDivHTML(name,btnId)+'</td>';
        //return '<td onclick="'+onclick+'" width style="background-repeat:no-repeat;margin:0px;padding:0px;cursor:'+cursor+';width:'+w+'px;height:'+h+'px;'+GigyaToolbar.generateImgStyle(name)+'"></td>';
    }
    GigyaToolbar.attachTooltip = function(el,txt) {
        if (el!=null) {
            el.onmouseover=function(){GigyaToolbar.showTooltip(txt,el)};
            el.onmouseout=function(){GigyaToolbar.hideTooltip()};
        }
    }
    GigyaToolbar.showTooltip = function (text,el) {
        var pos = GigyaToolbar._GetElementPos(el);
        document.getElementById('gigyaTBTooltip').innerHTML=text;
        GigyaToolbar.divTooltip.style.display='';
        GigyaToolbar.divTooltip.style.top = ''+pos.top+'px';
        GigyaToolbar.divTooltip.style.left = ''+(pos.left-GigyaToolbar.divTooltip.offsetWidth-1)+'px';
    }
    GigyaToolbar.hideTooltip = function () {
        GigyaToolbar.divTooltip.style.display='none';
    }
    GigyaToolbar.injectImp = function() {
        var imp = document.createElement('IMG');
        imp.style.width='1px';
        imp.style.height='1px';
        imp.style.visibility='hidden';  
        var time = new Date().getTime();
        imp.src = "http://counters.gigya.com/wildfire/pimp.ashx?name=WBP&m=0&g=0&d=Toolbar&p="+GigyaToolbar.partner+"&l="+time+"&pt="+time+"&CXNID=2000002.0NXC";
        document.body.appendChild(imp);        
    }
    GigyaToolbar.useCompMode = function() {
        return (window.attachEvent && (GigyaToolbar.isIE6 || document.compatMode=='BackCompat'))
    }
    GigyaToolbar.fireEvent = function(evt) {
        var imp = document.createElement('IMG');
        imp.style.width='1px';
        imp.style.height='1px';
        imp.style.visibility='hidden';    
        imp.src = 'http://counters.gigya.com/wildfire/pimp.ashx?name=CEVT&enc=0&cid=Toolbar&evt='+evt+'&pid='+GigyaToolbar.partner+'&buster=' + new Date().getTime();
        document.body.appendChild(imp);
    }    
    GigyaToolbar.getBoxHTML=function(content,caption,w,h,withBottom,withBubble,noPadding,onclose) {
        var i=0;
        var arHTML = [];
        var tableWidth=w+16;
        var tableHeight=h+34;
        //if (withBottom) tableHeight+=34;
        if (!noPadding) {
            tableWidth+=20;
        }        
        arHTML[i++]='<table dir="ltr" width="'+tableWidth+'" height="'+(tableHeight)+'" cellspacing="0" cellpadding="0" style="position:relative;z-index:99997;width:'+(tableWidth)+'px;height: '+(tableHeight)+'px;margin:0px;padding:0px;border-collapse:separate">';
        arHTML[i++]='<tr><td valign="top">';
        arHTML[i++]='<table width="100%" height="100%" style="margin:0px;padding:0px;border-collapse:separate" dir="ltr" cellspacing="0" cellpadding="0"><tr>';
        arHTML[i++]='<td width="13">'+GigyaToolbar.getCutDivHTML('dlg_topLeft')+'</td>';
        arHTML[i++]='<td nowrap style="white-space:nowrap;font-family:arial;font-weight:bold;font-size:13px;padding:0px;margin:0px;background-repeat:repeaty;text-align:left;padding-top:5px;color:'+GigyaToolbar.theme.captionColor+';'+GigyaToolbar.generateImgStyle('Dialog_TopMid')+';height:29px">'+caption+'</td>';
        arHTML[i++]='<td onclick="'+onclose+'" width="22" style="width:22px;cursor:pointer">'+GigyaToolbar.getCutDivHTML('dlg_topRight')+'</td></tr></table></tr>';
        
        var padding=10;
        if (noPadding) padding=0;        
        arHTML[i++]='<tr><td valign="top">';
        arHTML[i++]='<table width="100%" height="100%" style="margin:0px;padding:0px;border-collapse:separate" dir="ltr" cellspacing="0" cellpadding="0"><tr>';
        arHTML[i++]='<td width="8" style="width:8px;padding:0px;margin:0px;'+GigyaToolbar.generateImgStyle('Dialog_MidLeft')+'"></td>';
        arHTML[i++]='<td style="z-index:99997;background-color:#FFFFFF;margin:0px;padding:'+padding+'px;">'+content+'</td>';
        arHTML[i++]='<td width="8" style="width:8px;padding:0px;margin:0px;'+GigyaToolbar.generateImgStyle('Dialog_MidRight')+'"></td>';
        arHTML[i++]='</tr></table></td></tr>';
        if (withBottom) {
            arHTML[i++]='<tr><td valign="top">';
            arHTML[i++]='<table width="100%" style="margin:0px;padding:0px;border-collapse:separate" dir="ltr" cellspacing="0" cellpadding="0"><tr valign="top">';
            arHTML[i++]='<td valign="top" width="13" style="padding:0px;margin:0px">'+GigyaToolbar.getCutDivHTML('dlg_bottomLeft')+'</td>';
            if (withBubble) {
                arHTML[i++]='<td valign="top" width="28" style="padding:0px;margin:0px">'+GigyaToolbar.getCutDivHTML('dlg_bubble')+'</td>';
            }
            arHTML[i++]='<td valign="top" style="padding:0px;margin:0px;"><div style="'+GigyaToolbar.generateImgStyle('Dialog_BottomMid','scale')+';height: 12px; width:100%; background-repeat:repeaty; font-size:1px;">&nbsp;</div></td>';
            arHTML[i++]='<td valign="top" width="22" style="padding:0px;margin:0px;">'+GigyaToolbar.getCutDivHTML('dlg_bottomRight')+'</td>';
            arHTML[i++]='</tr></table></td></tr>';
        }        
        arHTML[i++]='</table>';  
        return arHTML.join('');    
    }    
    GigyaToolbar.domain=document.location.href.split('://')[1].split('/')[0].split('?')[0].split('#')[0];
    GigyaToolbar.init=function(){
        GigyaToolbar.theme = GigyaToolbar.themes[(typeof gs_theme=='undefined'?'gray':GigyaToolbar.theme=gs_theme)];
        if (typeof GigyaToolbar.theme=='undefined') GigyaToolbar.theme=GigyaToolbar.themes.gray;
            
        var imgTheme=new Image();
        imgTheme.onload=function(){
            GigyaToolbar.themeImageH=imgTheme.height;
            GigyaToolbar.themeImageW=imgTheme.width;
            GigyaToolbar.injectToolbar();
        }
        imgTheme.src=GigyaToolbar.theme.basePath+'theme.png';
    }
    GigyaToolbar.injectToolbar=function(){
        GigyaToolbar.createThemeMapping();
        var toolbarDiv = document.createElement('DIV');

	    toolbarDiv.id='toolbarDiv';
        toolbarDiv.style.bottom = '0px';
        toolbarDiv.style.width = '100%';
        toolbarDiv.style.height = '33px';
        toolbarDiv.style.margin = '0px';
        toolbarDiv.style.padding = '0px';

        
        toolbarDiv.style.left = '0px';
        toolbarDiv.style.right = '0px';
        GigyaToolbar.partner = 825901;
        if (typeof gs_partner!='undefined') GigyaToolbar.partner=gs_partner;
        GigyaToolbar.statusMessage = '';
        if (typeof gs_statusMessage!='undefined') GigyaToolbar.statusMessage=gs_statusMessage.replace('$url$',document.location.href);;
        
        GigyaToolbar.searchDomain=(typeof gs_searchDomain=='undefined'?true:gs_searchDomain);
        var hideSearch=(typeof gs_hideSearch=='undefined'?false:gs_hideSearch);
        
        var bgStyle = 'background-repeat:repeaty;'+GigyaToolbar.generateImgStyle('Bg_Mid');
        var i=0;
        var arTBHTML = [];
        arTBHTML[i++]='<table dir="ltr" id="gigyaTBToolbar" width="100%" cellspacing="0" cellpadding="0" style="height: 33px;margin:0px;padding:0px;border-collapse:separate"><tr valign="top">';
        arTBHTML[i++]='<td width="15" style="margin:0px;padding:0px;">'+GigyaToolbar.getCutDivHTML('bg_left')+'</td>'; 
        arTBHTML[i++]='<td width="16" style="margin:0px;padding:0px;padding-top:11px;'+bgStyle+'"><div style="width:16px">'+GigyaToolbar.generateImgDiv('http://www.google.com/s2/favicons?domain='+GigyaToolbar.domain, 16,16)+'</div></td>';
        if (!hideSearch) {
            arTBHTML[i++]='<td width="123" style="width:123px;margin:0px;padding:0px;padding-left:5px;'+bgStyle+'">';
            arTBHTML[i++]='<div style="position:absolute;top:0px">'+GigyaToolbar.getCutDivHTML('gsb')+'</div>';
            arTBHTML[i++]='<table width="123" dir="ltr" cellpadding="0" cellspacing="0" style="margin:0px;padding:0px;border-collapse:separate;position: relative; left: 2px;top:9px;height:20px"><tr><td>';
            arTBHTML[i++]='<input id="GigyaTBSearchInput" onkeypress="if (event.keyCode==13) GigyaToolbar.submitSearch()" type="text" style="border-color:transparent;height:13px;width: 100px;background-color: Transparent;border-style:none; font-size: 11px; color: '+GigyaToolbar.theme.textboxColor+'" />';
            arTBHTML[i++]='</td><td><div style="padding-left:4px;width: 16px;height:20px; cursor:pointer" onclick="GigyaToolbar.submitSearch()"></div></td></tr></table></td>';
        }
        arTBHTML[i++]='<td width="21" style="width:21px;margin:0px;padding:0px;'+bgStyle+'"><div style="width:21px"><center>'+GigyaToolbar.getCutDivHTML('separator')+'</center></div></td>';
        arTBHTML[i++]='<td width="430" style="margin:0px;padding:0px;'+bgStyle+'"><iframe id="gigyaTBifr" scrolling="no" style="height: 33px;position:relative;z-index:99999;visibility:hidden;margin:0px;padding:0px;border:none;background-color:Transparent" onload="this.style.visibility=\'visible\'" height="33" width="430" frameborder="0" allowtransparency="true"></iframe></td>';
        arTBHTML[i++]='<td style="margin:0px;padding:0px;'+bgStyle+'">&nbsp;</td>';
        if (typeof gs_facebookPageId=='string')
            arTBHTML[i++]=GigyaToolbar.generateImgTd('btnFanPage',2,'GigyaToolbar.fireEvent(\'Fan page view\');GigyaToolbar.generateIframeBox(\'http://www.facebook.com/connect/connect.php?id='+gs_facebookPageId+'&connections=10&stream=1\',\'Fan Page\',300,550,this,null,370,\'http://www.facebook.com/connect/connect.php?id='+gs_facebookPageId+'&connections=0&stream=1\')','GigyaTBFanPage');
        if (typeof gs_twitterName=='string')            
            arTBHTML[i++]=GigyaToolbar.generateImgTd('btnUpdates',2,'GigyaToolbar.fireEvent(\'Twitter updates view\');GigyaToolbar.generateIframeBox(\'http://toolbar.cdn.gigya.com/ifrTweet.htm?twitterName='+gs_twitterName+'\',\'Twitter Updates\',250,390,this)','GigyaTBTweet');
        arTBHTML[i++]=GigyaToolbar.generateImgTd('btnShare',10,'','gs_btnShare');
        arTBHTML[i++]=GigyaToolbar.generateImgTd('btnEmail',6,'','gs_btnEmail');
        if (typeof gs_RSSUrl=='string')
            arTBHTML[i++]=GigyaToolbar.generateImgTd('btnRSS',2,'GigyaToolbar.fireEvent(\'RSS\');window.open(\''+gs_RSSUrl+'\')','GigyaTBRSS');
        arTBHTML[i++]=GigyaToolbar.generateImgTd('btnInfo',2,'window.open(\'http://wiki.gigya.com/030_Gigya_Socialize_API_2.0/Social_Toolbar\')', 'GigyaTBInfo');
        arTBHTML[i++]='<td width="24" style="margin:0px;padding:0px;"><div id="GigyaTBCollapse" onclick="GigyaToolbar.collapse()" style="cursor: pointer">'+GigyaToolbar.getCutDivHTML('collapse')+'</div></td></tr></table>';   

        var divTooltip = document.createElement('div');    
        divTooltip.innerHTML = '<table style="width: auto;margin:0px;padding:0px;border-collapse:separate" dir="ltr" cellpadding="0" cellspacing="0" height="19"><tr nowrap><td nowrap style="margin:0px;padding:0px;padding: 3px; height: 19px; background-color: #999999; color: #FFFFFF; font-size: 12px; font-family: arial"><div id="gigyaTBTooltip"></div></td><td width="10" height="19" style="margin:0px;padding:0px;">'+GigyaToolbar.getCutDivHTML('bubbleRight')+'</td></tr></table></div>';
        divTooltip.style.zIndex=99998;
        divTooltip.style.display='none';
        toolbarDiv.innerHTML = arTBHTML.join('');

        var divExpand = document.createElement('div');    
       
        divExpand.innerHTML = '<div id="divExpand" style="cursor:pointer" onclick="GigyaToolbar.expand()">'+GigyaToolbar.getCutDivHTML('expand')+'</div>';

        
        toolbarDiv.style.display='none';
        divExpand.style.display='none';
        
        divExpand.style.zIndex=99998;
        toolbarDiv.style.zIndex=99998;
    
        if (GigyaToolbar.useCompMode()) {
            divExpand.style.position='absolute';
            divTooltip.style.position = 'absolute';
        } else {
            divExpand.style.position='fixed';
            divTooltip.style.position = 'fixed';
        }
        divExpand.style.bottom='0px';
        divExpand.style.right='0px';
        
        
        GigyaToolbar.divTooltip = divTooltip;
        GigyaToolbar.divExpand = divExpand;
        GigyaToolbar.toolbarDiv = toolbarDiv;
        document.body.appendChild(toolbarDiv);
        document.body.appendChild(divExpand);
        document.body.appendChild(divTooltip);     
        
        if (window.addEventListener) {
            window.addEventListener('resize',GigyaToolbar.onResize,false);
        }
        if (window.attachEvent) {
            window.attachEvent('onresize',GigyaToolbar.onResize);
        }
        if (GigyaToolbar.useCompMode()) {
            toolbarDiv.style.position = 'absolute';
            toolbarDiv.style.width = document.documentElement.clientWidth;
            window.attachEvent('onresize', GigyaToolbar.fixPositions);
            window.attachEvent('onscroll', GigyaToolbar.fixPositions);
            GigyaToolbar.fixPositions();
        } else {
            toolbarDiv.style.position = 'fixed';
        }    
        document.getElementById('gs_btnShare').onclick = function() {
            var body = (typeof gs_body!='undefined')?gs_body:'Hi,<br><br>$userMsg$<br><br>I thought you\'d like this:<br>$URL$<br><br>$sender$<br>';
            var subject = (typeof gs_subject!='undefined')?gs_subject:'Take a look at this';
            GigyaToolbar.generateIframeBox('http://toolbar.cdn.gigya.com/ifrWF.htm?type=share&partner='+escape(GigyaToolbar.partner)+'&subject='+escape(subject)+'&body='+escape(body)+'&url='+escape(document.location.href),'Share This Page',260,210,document.getElementById('gs_btnShare'),true)
        };
        document.getElementById('gs_btnEmail').onclick = function() {
            var body = (typeof gs_body!='undefined')?gs_body:'Hi,<br><br>$userMsg$<br><br>I thought you\'d like this:<br>$URL$<br><br>$sender$<br>';
            var subject = (typeof gs_subject!='undefined')?gs_subject:'Take a look at this';
            GigyaToolbar.generateIframeBox('http://toolbar.cdn.gigya.com/ifrWF.htm?type=email&partner='+escape(GigyaToolbar.partner)+'&subject='+escape(subject)+'&body='+escape(body)+'&url='+escape(document.location.href),'Email This Page',260,210,document.getElementById('gs_btnEmail'),true)
        };
        
        GigyaToolbar.attachTooltip(document.getElementById('gs_btnShare'), 'Share this page');
        GigyaToolbar.attachTooltip(document.getElementById('gs_btnEmail'), 'Email this page');
        GigyaToolbar.attachTooltip(document.getElementById('GigyaTBInfo'), 'Learn more about the Gigya Toolbar');
        GigyaToolbar.attachTooltip(document.getElementById('divExpand'), 'Show Toolbar');
        GigyaToolbar.attachTooltip(document.getElementById('GigyaTBCollapse'), '');    
        if (typeof gs_twitterName!='undefined') GigyaToolbar.attachTooltip(document.getElementById('GigyaTBTweet'), 'Read '+gs_twitterName+'\'s tweets');    
        GigyaToolbar.attachTooltip(document.getElementById('GigyaTBFanPage'), 'Facebook Fan Page');    
        GigyaToolbar.attachTooltip(document.getElementById('GigyaTBRSS'), 'Subscribe to feed');    
        
        var showWelcome=(typeof gs_showWelcome=='undefined'?false:gs_showWelcome) && (GigyaToolbar.readCookie('GTB_showedWelcome')!='1');
        var welcomeMessage=(typeof gs_welcomeMessage=='undefined'?'Use the toolbar below to stay updated and to share stuff from this site on Facebook, Twitter and more.':gs_welcomeMessage);
        if (showWelcome) {
            GigyaToolbar.divWelcome=document.createElement('div');
            var domain=document.location.href.split('://')[1].split('/')[0].split('?')[0].split('#')[0];
            var caption='Welcome to '+domain+'&nbsp;&nbsp;';
            var body='<div style="font-size:12px;font-family:Arial;color:'+GigyaToolbar.theme.baseColor+'">'+welcomeMessage+'</div>';
            GigyaToolbar.divWelcome.innerHTML=GigyaToolbar.getBoxHTML(body,caption,235,60,true,true,false,'GigyaToolbar.disposeElement(\'divWelcome\')');
            if (GigyaToolbar.useCompMode()) {
                GigyaToolbar.divWelcome.style.position='absolute';
            } else {
                GigyaToolbar.divWelcome.style.position='fixed';
                GigyaToolbar.divWelcome.style.bottom='26px';
            }
            GigyaToolbar.divWelcome.style.left='0px';
            
            document.body.appendChild(GigyaToolbar.divWelcome);
            if (GigyaToolbar.useCompMode()) GigyaToolbar.fixPositions();
            GigyaToolbar.createCookie('GTB_showedWelcome','1',365);
        }
        
        if (GigyaToolbar.readCookie('GTB_showToolbar')=='0') {
            GigyaToolbar.collapse();
        } else {
            GigyaToolbar.expand();
        }        
        
        GigyaToolbar.injectImp();
    }
    GigyaToolbar.createCookie = function(name,value,days) {
	    if (days) {
		    var date = new Date();
		    date.setTime(date.getTime()+(days*24*60*60*1000));
		    var expires = "; expires="+date.toGMTString();
	    }
	    else var expires = "";
	    document.cookie = name+"="+value+expires+"; path=/";
    }

    GigyaToolbar.readCookie = function(name) {
	    var nameEQ = name + "=";
	    var ca = document.cookie.split(';');
	    for(var i=0;i < ca.length;i++) {
		    var c = ca[i];
		    while (c.charAt(0)==' ') c = c.substring(1,c.length);
		    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	    }
	    return null;
    }
    GigyaToolbar.removeIframeBox=function(){
        GigyaToolbar.disposeElement('gigyaTBBox'); 
    }

	GigyaToolbar.submitSearch=function() {
        var q = document.getElementById('GigyaTBSearchInput').value;
        if (GigyaToolbar.searchDomain) q+=' site:'+GigyaToolbar.domain;
        
        var w=1000;
        var h=600;
        var content='<iframe src="http://toolbar.cdn.gigya.com/search.htm?cx=partner-pub-7587343851693506%3Aajh07i-j8ra&cof=FORID%3A10&ie=UTF-8&q='+encodeURI(q)+'&sa=Search" id="gigyaTBSearchIfr" scrolling="no" style="position:relative;z-index:99999;visibility:hidden;margin:0px;padding:0px;border:none;background-color:Transparent" onload="this.style.visibility=\'visible\'" height="'+h+'" width="'+w+'" frameborder="0" allowtransparency="true"></iframe></td>';
        /*GigyaToolbar.divSearchPopup=document.createElement('div');
        GigyaToolbar.divSearchPopup.style.position='absolute';
        GigyaToolbar.divSearchPopup.style.top='0px';
        GigyaToolbar.divSearchPopup.style.left='0px';
        GigyaToolbar.divSearchPopup.innerHTML=GigyaToolbar.getBoxHTML(content,'Search results for '+document.getElementById('GigyaTBSearchInput').value, w, h, true, false, false, 'document.body.removeChild(GigyaToolbar.divSearchPopup)');
        document.body.appendChild(GigyaToolbar.divSearchPopup)*/
        window.open('http://toolbar.cdn.gigya.com/search.htm?cx=partner-pub-7587343851693506%3Aajh07i-j8ra&cof=FORID%3A10&ie=UTF-8&q='+encodeURI(q)+'&sa=Search');
        GigyaToolbar.fireEvent('search');
    }
    GigyaToolbar.generateIframeBox=function(src,caption,w,h,el,noPadding,altH,altSrc){
        var clientHeight=document.documentElement.clientHeight;
        if (clientHeight==0) clientHeight=document.body.clientHeight;  
        if (altH && altSrc && h+80>clientHeight) {
            h=altH;
            src=altSrc;
        }  
        if (h+80>clientHeight) h=clientHeight-80;
        GigyaToolbar.currentIframeButton=el;
        var elImg=document.getElementById(el.id+'_img');
        if (elImg!=null) GigyaToolbar.currentIframeButton=elImg;        
        GigyaToolbar.removeIframeBox();
        var divBox=document.createElement('div');
        divBox.id='gigyaTBBox';
        
        var content='<div id="gigyaTBBoxPreloader"><table style="border-collapse:separate" width="'+w+'" height="'+h+'"><tr><td><center><img src="http://toolbar.cdn.gigya.com/i/ajax-loader.gif" /></center></td></tr></table></div><div id="GigyaTBIframeBox" style="display:none;height:'+h+'px">&nbsp;</div>';
        divBox.innerHTML=GigyaToolbar.getBoxHTML(content,caption,w,h,false,false,noPadding,'GigyaToolbar.removeIframeBox()');
        
        if (GigyaToolbar.useCompMode()) {
            divBox.style.position='absolute';
        } else {
            divBox.style.position='fixed';
            divBox.style.bottom='26px';
        }
        divBox.style.visibility='hidden';
        document.body.appendChild(divBox); 
        GigyaToolbar.gigyaTBBox=divBox;
        GigyaToolbar.onResize();
        if (GigyaToolbar.useCompMode()) GigyaToolbar.fixPositions();
        divBox.style.visibility='visible';
        
        var ss='if (document.getElementById(\'GigyaTBIframeBox\')) document.getElementById(\'GigyaTBIframeBox\').innerHTML=\'<iframe id="gigyaTBBoxifr" scrolling="no" style="width:'+w+'px;position:relative;z-index:99997;display:none;margin:0px;padding:0px;border:none;background-color:Transparent" onload="document.getElementById(\\\'GigyaTBIframeBox\\\').style.display=\\\'\\\';document.getElementById(\\\'gigyaTBBoxPreloader\\\').style.display=\\\'none\\\';this.style.display=\\\'\\\'" height="'+h+'" width="'+w+'" frameborder="0" allowtransparency="true" src="'+src+'"></iframe>\';';
        window.setTimeout(ss,500);
    }
    
    }    
    GigyaToolbar.dispose = function() {
        GigyaToolbar.disposeElement('divTooltip');
        GigyaToolbar.disposeElement('divExpand');
        GigyaToolbar.disposeElement('divWelcome');
        GigyaToolbar.disposeElement('toolbarDiv');
        GigyaToolbar.disposeElement('gigyaTBBox');
    }    
    if (window.attachEvent) {
        window.attachEvent('onload',GigyaToolbar.init);
    } else if (window.addEventListener) {
        window.addEventListener('load',GigyaToolbar.init,false);
    }
}